<div id="viewer-container" class="viewer-container"></div>
<script>
  let viewer = undefined

  function loadChinaLine(){
    let layer_china  = new DC.VectorLayer('layer-china')
    let chainData = new DC.GeoJsonLayer('china','examples/data/china.geojson')
    let now = DC.JulianDate.now()
    chainData.eachOverlay(entity => {
      if(entity.polygon){
        let positions = DC.Transform.transformCartesianArrayToWGS84Array(
          entity.polygon.hierarchy.getValue(now).positions
        )
        let polyline = new DC.Polyline(positions)
        polyline.setStyle({
          material:new DC.PolylineFlickerMaterialProperty({
            speed:10 * Math.random()
          })
        })
        layer_china.addOverlay(polyline)
      }
    })
    viewer.addLayer(layer_china)
  }

      DC.config.baseUrl = '../libs/dc-sdk/resources/'
      let viewer = new DC.Viewer('viewer-container')
    let  baseLayer = DC.ImageryLayerFactory.createAMapImageryLayer({
      style: 'img'
    })
     baseLayer.defaultBrightness = 0.05
    viewer.addBaseLayer( baseLayer)
    viewer.flyToPosition("112.25902819,29.43306223,8813200.25,355,-89.5",()=>{
      loadChinaLine()
    })
  }


</script>
